In recent years, devices having functions both as an access point (AP) of infrastructure communication of wireless local area network (LAN) compliant with IEEE802.11 series, and as a station (STA) which connects and communicates with the AP, have come on the market. Such a device can construct a network as an AP, and also can participate in a network constructed by other APs as an STA.
An example of communication device which can switch the role of the device (base device, slave device) is discussed in Japanese Patent Application Laid-Open No. 2006-005844 and Japanese Patent Application Laid-Open No. 2003-152730.
An example of communication device in which a function of a relay station (access point) and a function of a station are operated at the same time is discussed in U.S. Pat. No. 7,362,722 (Japanese Patent Application Laid-Open No. 2005-086350).
When AP and STA communicate with each other, there are many setting items which need to be set before use. For example, the setting items include communication parameters to perform wireless communication, such as a service set identifier (SSID) as a network identifier, an encryption method, an encryption key, an authentication method, and an authentication key. To set these communication parameters, automatic setting methods for simply setting communication parameters to a wireless communication device are devised by various manufacturers. In these automatic setting methods, communication parameters are automatically set by providing communication parameters from one device to another device using a procedure and a message predetermined between the devices to be connected to each other.
Non Patent Literature 1 discusses Wi-Fi protected setup (hereinafter, WPS), which is an industry standard of a communication parameter automatic setting method between AP and STA.
When performing wireless communication between the devices having both functions of the AP function and the STA function, the communication is possible when one device constructs a network as an AP and the other device connects to the network as an STA. When devices, which are in an initial state and operate neither as AP nor as STA, try to communicate with each other, the roles of the devices need to be determined, for example, a device which becomes AP is determined.
In this case, when user's convenience is considered, it is desired that the determination of the roles is automatically performed between the devices. However, a method in which the roles are automatically determined between the devices without requiring user's operation has not been established. Therefore, when the devices have both the AP function and the STA function, the automatic setting processing of communication parameters cannot be performed, so that there is a problem that the devices operating both as AP and as STA cannot easily communicate with each other.